package initialize

import (
	"github.com/bndr/gojenkins"
	"server/common"
)

type JenkinsSetting struct {
	URL      string
	USER     string
	PASSWORD string
}

func InitJenkins(j *JenkinsSetting) *gojenkins.Jenkins {
	jenkins := gojenkins.CreateJenkins(nil, j.URL, j.USER, j.PASSWORD)
	_, err := jenkins.Init(common.CTX)
	if err != nil {
		return nil
	}
	return jenkins
}
